﻿@using Volo.Abp.Users
@using Volo.Abp.MultiTenancy
@using Microsoft.Extensions.Localization
@using global::Localization.Resources.AbpUi
@inject ICurrentUser CurrentUser
@inject ICurrentTenant CurrentTenant
@inject IJSRuntime JsRuntime
@inject NavigationManager Navigation
@inject IStringLocalizer<AbpUiResource> L

<AuthorizeView>
    <Authorized>
        <Dropdown>
             <Overlay>
                 <Menu>
                     @if (Menu != null)
                     {
                         @foreach (var menuItem in Menu.Items)
                         {
                             <a class="nav-link ant-dropdown-menu-item" target="@menuItem.Target" href="@menuItem.Url?.TrimStart('/', '~')">@menuItem.DisplayName</a>
                         }
                     }
                     <MenuDivider/>
                 </Menu>
             </Overlay>
             <ChildContent>
                @if (CurrentTenant.Name != null)
                {
                    <span><i>@CurrentTenant.Name</i>\@CurrentUser.UserName</span>
                }
                else
                {
                    <span>@CurrentUser.UserName</span>
                }
                <Icon Type="down" />
             </ChildContent>
         </Dropdown>
    </Authorized>
    <NotAuthorized>
        <a class="nav-link" href="Account/Login">@L["Login"]</a>
    </NotAuthorized>
</AuthorizeView>
